<%@ page import="weaver.general.Util" %>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%
    String json = "{\"flag\":\"0\"}";
    String sapcode = Util.null2String(request.getParameter("sapcode"));//sap code
    rs.executeQuery("select tpsc from uf_sapcodetp where sapcode='"+sapcode+"'");
    rs.next();
    String tpsc = Util.null2String(rs.getString("tpsc"));
    rs1.executeQuery("select imagefileid from docimagefile where docid = '"+tpsc+"'");
    if(rs1.next()){
        String imagefileid = Util.null2String(rs1.getString("imagefileid"));
        json ="{\"flag\":\"1\",\"imagefileid\":\"" + imagefileid + "\",\"tpsc\":\"" + tpsc + "\"}";
    }
    bb.writeLog(json);
    out.print(json);
%>